//package com.bootdo.screen.controller;
//import com.bootdo.screen.domain.StreamInfo;
//import com.bootdo.screen.service.StreamInfoService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.ResponseEntity;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//
//
//import java.util.Map;
//
//
//import static org.springframework.http.ResponseEntity.ok;
//import static org.springframework.web.bind.annotation.RequestMethod.GET;
//import static org.springframework.web.bind.annotation.RequestMethod.POST;
//
//
//@Controller
//@RequestMapping(path = "screen")
//public class StreamInfoController {
//
//    @Autowired
//    private StreamInfoService streamInfoService;
//
//
//    @RequestMapping(path = "save", method = GET)
//    public ResponseEntity<?> writeValue() {
//        StreamInfo streamInfo = new StreamInfo();
//        streamInfo.setAudiorate(1);
//        streamInfo.setBitrate(2);
//        streamInfo.setFramerate(3);
//        streamInfo.setVideorate(4);
//        streamInfo.setStreamName("name");
//        streamInfoService.save(streamInfo);
//
//        return ok("success");
//    }
//
//    @RequestMapping(path = "get", method = GET)
//    public ResponseEntity<?> getLatestValue() {
//        return ok(streamInfoService.getLatest());
//    }
//
//    private boolean isValidInput(Map<String, Object> input) {
//        return input.containsKey("value") && input.get("value") != null;
//    }
//}